/***************************************************************************
 *            globe.h
 *
 *  Tue Jun 17 21:42:51 2009
 *  Copyright  2009  fantasy
 *  <fantasy614@gmail.com>
 ****************************************************************************/

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
 */

#ifndef _GLOBE_H_
#define _GLOBE_H_

/*GNU solutions bool in c */
#ifdef HAVE_STDBOOL_H
#include<stdbool.h>
#else
#ifndef HAVE__BOOL
#ifdef __cplusplus
typedef bool _Bool ;
#else
#define _Bool signed char
#endif
#endif
#define bool _Bool
#define false 0
#define true 1
#define __bool_true_false_are_defined 1
#endif

#define IP 0

//记录每个棋子的位置
struct  piece
{
	int loc;
	int index;//用于评价函数
};

struct piece black_side[16];
struct piece red_side[16];

struct
{
    enum
    {
        RED=1,
        BLACK
    }side_go ;
}chess_state ;

struct board
{
    int board_x ;
    int board_y ;
};

struct _move
{
    struct board  *src_pos ;
    int src_chessman ;
    struct board  *des_pos ;
    int des_chessman ;
}*now_move ;//now_move用来记录当前的走法


extern int chessman_state[256];

struct move
{
    int src ;
    int des ;
};
struct move *red_move,*black_move ;
enum
{
    R_General=1,R_Advisor,R_Elephant,R_Horse,R_Chariot,R_Soldier,
    R_Cannon,
    RED_KING_DIE,BLACK_KING_DIE,
    NULL_CHESSMAN,
    B_General,B_Advisor,B_Elephant,B_Horse,B_Chariot,B_Soldier,
    B_Cannon,
    SELECTED_CHESSMAN,
};
extern bool black_die;
extern bool red_die;
#endif


